package main

//func main() {
//	nums := []int{3, 3}
//	target := 6
//
//	println(intArrToString(nums))
//	result := twoSum(nums, target)
//	println(intArrToString(result))
//}

func twoSum(nums []int, target int) []int {
	hash := map[int]int{}

	var i int
	var item int
	var hashItem int
	var exist bool
	for i, item = range nums {
		//println(item)

		hashItem, exist = hash[item]
		if exist {
			return []int{hashItem, i}
		}
		hash[target-item] = i

	}
	return nil
}
